#!/bin/bash

# 环境设置
export ASCEND_HOME=/usr/local/Ascend/ascend-toolkit/latest
export LD_LIBRARY_PATH=${ASCEND_HOME}/lib64:$LD_LIBRARY_PATH

# 生成测试数据
python3 gen_data.py

# 编译算子
mkdir -p build && cd build
cmake .. -DCMAKE_INSTALL_PREFIX=./install
make -j && make install
cd ..

# 运行测试程序
./build/main \
    --input=data/input_x.bin \
    --output=data/output.bin \
    --shape=1024 \
    --dtype=float32

# 验证结果
python3 verify_result.py